
import java.awt.Container;

import javax.swing.*;

public class DesktopPanel {

    public static void main(String[] args) {
        JFrame.setDefaultLookAndFeelDecorated(true);
        JDialog.setDefaultLookAndFeelDecorated(true);
        JFrame jf = new JFrame();
        jf.setTitle("表格组件");
        jf.setSize(600, 500);
        jf.setLocationRelativeTo(null);
        jf.setDefaultCloseOperation(jf.EXIT_ON_CLOSE);
        Container c = jf.getContentPane();

        JDesktopPane desktopPan = new JDesktopPane();// 创建桌面面板对象
        desktopPan.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);// 设置内部窗体的拖拽方式
        c.add(desktopPan);
        // 创建内部窗体
        JInternalFrame inFrame1 = new JInternalFrame("第一个内部窗体", true, true, true, true);
        JInternalFrame inFrame2 = new JInternalFrame("第二个内部窗体", true, true, true, true);
        JInternalFrame inFrame3 = new JInternalFrame("第三个内部窗体", true, true, true, true);
        desktopPan.add(inFrame1);
        inFrame1.setBounds(50, 50, 200, 200);
        inFrame1.setVisible(true);
        desktopPan.add(inFrame2);
        inFrame2.setBounds(90, 90, 200, 200);
        inFrame2.setVisible(true);
        desktopPan.add(inFrame3);
        inFrame3.setBounds(130, 130, 200, 200);
        inFrame3.setVisible(true);

        jf.setVisible(true);

    }


}
